<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <link rel="stylesheet" href="/${BasePath}/static/mobile/css/base.css" />
    <link rel="stylesheet" href="/${BasePath}/static/mobile/css/style.css" />
    <link rel="stylesheet" href="/${BasePath}/static/mobile/css/swiper.min.css" />
    <link rel="stylesheet" href="/${BasePath}/static/mobile/css/ydui.css" />
    <link rel="stylesheet" href="/${BasePath}/static/mobile/css/validate.css" />
    <title>半岛云</title> 
</head>
<body>
    <input type="hidden" id="active" value="grzx">
	<div class="wrap">
	<!--标题栏-->
	<div class="fixed_top">
		<div class="top-l"><a href="javascript:window.history.back()"><i class="icons">&#xe626;</i></a></div>
		<h2>意见反馈</h1>
	</div>
	<div class="container">
		<form id="viewForm">
			<ul class="yj_list">
<!-- 				<li>
					<label>选择问题类型<span class="red">*</span></label>
				</li> -->
				<li>
					<label>反馈意见<span class="red">*</span></label>
					<textarea placeholder="请填写您的建议/意见" name="viewSynopsis" autocomplete="off" data-required="true" data-descriptions="username"></textarea>
				</li>
				<li>
					<label>联系方式<span class="red">*</span></label>
					<input type="text" name="contact" placeholder="请输入您的手机号码" autocomplete="off" data-validate="phone" data-describedby="phone-description" />
				</li>
			</ul>
		</form>
	</div>
		<a class="tj">提 交</a>
		
		<#include "/common/foot.html">
		
	</div>
</body>
<script type="text/javascript" src="/${BasePath}/static/mobile/js/ydui.flexible.js"></script>
<script type="text/javascript" src="/${BasePath}/static/mobile/js/ydui.js"></script>
<script type="text/javascript" src="/${BasePath}/static/mobile/js/jquery-mvalidate.js"></script>
<script type="text/javascript">   
$(function(){	
    $.mvalidateExtend({
        phone:{
            required : true,   
            pattern : /^1[34578]\d{9}$/,
            each:function(){  
            },
            descriptions:{
                required : '<div class="field-invalidmsg">请输入手机号码</div>',
                pattern : '<div class="field-invalidmsg">您输入的手机号码格式不正确</div>',
                valid : '<div class="field-validmsg">正确</div>'
            }
        }
    });
   
    $("#viewForm").mvalidate({
        type:1,
        onKeyup:true,
        sendForm:false,
        onKeyup:true,
        firstInvalidFocus:true,
        eachField:function(){

        },
        valid:function(){
            $.ajax({
                cache: true,
                type: "POST",
                url: "/${BasePath}/free/saveYjfk",
                data: $('#viewForm').serialize(),
                async: false,
                error: function(request) {
                	YDUI.dialog.alert('提交失败，请稍后再试！');
                },
                success: function(data) {
                    if(data.code = "1") {
                    	YDUI.dialog.alert(data.msg, function(){
                    		window.location.href="/${BasePath}/free/main";   
                    	}); 
                    } else {
                    	YDUI.dialog.alert(data.msg);
                    }
                }
            });                
        },
        invalid:function(){
           
        },
        eachValidField:function(){
          
        },
        eachInvalidField:function(){
           
          
        },
        descriptions:{
            username:{
                required : '<div class="field-invalidmsg">请填写您的建议/意见</div>',
                valid : '<div class="field-validmsg">验证通过</div>'
            }, 
        }
    });
    
    $(".tj").click(function(){
    	 $('#viewForm').submit();
    });

})

	
</script>
</html>